﻿using System;

namespace ChiakiYu.Web
{
    /// <summary>
    ///     权限验证，表单提交无需设置，通过ValidateAntiForgeryToken来验证
    /// </summary>
    public class EnablePermissionAttribute : Attribute
    {
        /// <summary>
        ///     开启权限验证
        /// </summary>
        /// <param name="description">描述文字</param>
        /// <param name="enabled">是否开始（默认开启）</param>
        public EnablePermissionAttribute(string description, bool enabled = true)
        {
            Description = description;
            Enabled = enabled;
        }

        /// <summary>
        ///     描述文字
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        ///     是否开启（默认开启）
        /// </summary>
        public bool Enabled { get; set; }
    }
}